<template>
  <div class="wx-jump">
    <!-- <wx-open-launch-app
      ref="wxjumpRef"
      id="launch-btn"
      appid="wxf081fa6307ff319a"
      :extinfo="scheme"
      @click="log('click', $event)"
      @launch="log('launch', $event)"
      @error="log('error', $event)"
    >
      <template>
        <div style="font-size: 60px">
          没跳就点我一下?ssss
        </div>
      </template>
    </wx-open-launch-app> -->
    <!-- <ul class="list">
      <li v-app-jump="{ to: url }" v-for="(url, index) in urls" :key="url">
        {{ index + 1 }}. {{ url }}
      </li>
    </ul> -->
    <iframe
      style="width: 100%;min-height: 100vh;max-height:100vh"
      src="https://jimu.movtile.com/index-m.html"
      frameborder="0"
    ></iframe>
  </div>
</template>

<script>
  import qs from 'qs';

  export default {
    data() {
      return {
        scheme: '',
        urls: [
          // 'mtjimu://works?id=astgp7xfqdfe',
          // 'mtjimu://topic?id=t3akz0ehegw9',
          // 'mtjimu://opinion?id=tswt0ehrn1hf',
          // 'mtjimu://channel?id=22',
          // 'mtjimu://subchannel?id=10',
          // 'mtjimu://rank',
          // 'mtjimu://creators',
          // 'mtjimu://todays',
          // 'mtjimu://articles',
          // `mtjimu://webview?url=${encodeURIComponent('https://jimu.movtile.com')}`,
          // `mtjimu://webview?url=${encodeURIComponent(
          //   'https://www.baidu.com/s?wd=郭德纲&rsv_spt=1&rsv_iqid=0xaf6b5acb00024b7d&issp=1&f=8&rsv_bp=1&rsv_idx=2&ie=utf-8&tn=baiduhome_pg&rsv_dl=tb&rsv_enter=1&rsv_sug3=9&rsv_sug1=12&rsv_sug7=101&rsv_sug2=0&rsv_btype=i&prefixsug=%25E9%2583%25AD%25E5%25BE%25B7%25E7%25BA%25B2&rsp=9&inputT=2379&rsv_sug4=2379',
          // )}`,
          // 'mtjimu://mymessage?type=comment',
          // 'mtjimu://mymessage?type=invitation',
          // 'mtjimu://mymessage?type=notice',
          // 'mtjimu://mymessage?type=chat',
        ],
      };
    },
    mounted() {
      const query = qs.parse(window.location.href.split('?')[1]);
      if (query && query.scheme && !this.$UA.isJM) {
        window.location.href = query.scheme;
      }
      wx.ready(() => {
        this.$setShareInfo({
          title: '积幕 - 堆积无穷灵感',
          subTitle: '数字创作灵感社区',
          image: 'https://ketang-pub.movtile.com/res/weixin-share-logo.png',
          url: window.location.href,
        });
      });
    },
    methods: {
      log(event, e = {}) {
        alert(event + JSON.stringify(e) + ': ' + this.scheme);
      },
    },
  };
</script>

<style lang="less" scoped>
  .wx-jump {
    min-height: 100vh;
    font-size: 0;
    // padding: 20px 0;

    .list {
      list-style: disc;
      font-size: 30px;
      line-height: 2;
    }
  }
</style>
